package com.victor.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.victor.entity.Messageboard;

@Mapper
public interface MessageboardDao {

	/**
	 * 新建留言
	 * 
	 * @param messageboard
	 * @return
	 */
	@Insert({ "INSERT INTO messageboard (m_name,m_phone,m_content,m_time) VALUES (#{m_name},#{m_phone},#{m_content},NOW())" })
	int build(Messageboard messageboard);

	/**
	 * 查询所有留言
	 * 
	 * @return
	 */
	@Select({ "SELECT * FROM messageboard ORDER BY id DESC" })
	List<Messageboard> getAll();

	/**
	 * 批量删除留言
	 * 
	 * @param ids
	 * @return
	 */
	boolean batchDelete(int[] ids);

}
